import Mock from 'mockjs2'
import { builder } from '@/mock/util'
import * as codeData from '../data/codeDetail'

// 部门
const codeDetail1 = () => {
  const result = codeData.codeDetailList.filter(value => value.codeType === 1)
  return builder(result)
}
// 项目
const codeDetail2 = () => {
  const result = codeData.codeDetailList.filter(value => value.codeType === 2)
  return builder(result)
}
// 证书类型
const codeDetail3 = () => {
  const result = codeData.codeDetailList.filter(value => value.codeType === 3)
  return builder(result)
}
// 证书类型
const codeDetail5 = () => {
  const result = codeData.positionStatus
  return builder(result)
}
// const buttons = () => {
//   return builder(codeData.buttonList)
// }
// const pageMenu = () => {
//   return builder(data.pageList)
// }
// const roleNames = () => {
//   return builder(data.roleNames)
// }
// const topMenu = () => {
//   return builder(data.topMenu)
// }
Mock.mock(/\/codeDetail\/1/, 'get', codeDetail1)
Mock.mock(/\/codeDetail\/2/, 'get', codeDetail2)
Mock.mock(/\/codeDetail\/3/, 'get', codeDetail3)
Mock.mock(/\/codeDetail\/5/, 'get', codeDetail5)
// Mock.mock(/\/common\/buttons/, 'get', buttons)
// Mock.mock(/\/pageMenu/, 'get', pageMenu)
// Mock.mock(/\/roleNames/, 'get', roleNames)
// Mock.mock(/\/topMenu/, 'get', topMenu)
